/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Beans;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import laLogica.AgregacionVacaLocal;

/**
 *
 * @author Felipe
 */

public class Vaca{
    AgregacionVacaLocal agregacionVaca = lookupAgregacionVacaLocal();

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
    int codigo;

    public int getCodigo() {
        return codigo;
    }

    public void setCodigo(int codigo) {
        this.codigo = codigo;
    }

    private AgregacionVacaLocal lookupAgregacionVacaLocal() {
        try {
            Context c = new InitialContext();
            return (AgregacionVacaLocal) c.lookup("java:global/lasVacas/lasVacas-ejb/AgregacionVaca!laLogica.AgregacionVacaLocal");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }



}
